﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using StoragePeriod.IDAL.RawDict;
using StoragePeriod.DALFactory;
using StoragePeriod.Model.RawDict;

namespace StoragePeriod.BLL.RawDict
{
    /// <summary>
    /// 原料分类操作
    /// </summary>
    public class T_RawMaterialsInfo
    {
        I_RawMaterialsInfo dal = new DataAccess<I_RawMaterialsInfo>().CreateInstance("RawDict.D_RawMaterialsInfo");

        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(int id)
        {
            return dal.Exists(id);
        }

        /// <summary>
        /// 获取符合要求的原料分类信息
        /// </summary>
        public List<E_RawMaterialsInfo> GetModelListByWhere(E_RawMaterialsInfo eRawMaterialsInfo)
        {
            return dal.GetModelListByWhere(eRawMaterialsInfo);
        }

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public void Add(E_RawMaterialsInfo model)
        {
            dal.Add(model);
        }

        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(E_RawMaterialsInfo model)
        {
            return dal.Update(model);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete(int id)
        {
            return dal.Delete(id);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool DeleteList(string idlist)
        {
            return dal.DeleteList(idlist);
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public E_RawMaterialsInfo GetModel(int id)
        {
            return dal.GetModel(id);
        }
    }
}
